<%@ page contentType="text/html; charset=utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/resource/css/default.css" />
		<link rel="stylesheet" type="text/css" href="${contextPath}/resource/tree/zTreeStyle/zTreeStyle.css" />
		<script type="text/javascript" src="${contextPath}/resource/tree/jquery-1.4.2.js"></script>
		<script type="text/javascript" src="${contextPath}/resource/tree/jquery.ztree-2.6.js"></script>
		
		<script language="JavaScript">
       function submitFrom(fm){
	    var title =document.getElementById("phoneSubInfo.xfBt").value;
		if(title ==""){
			alert("信息标题不能为空 !");
			return;
		}else if($.trim(title) == ''){
		    alert("此处不能为空格 !");
			return;			
		}else if (getLength(title) > 0 && getLength(title) > 4) {
            alert("不能多于4个字符,汉字占两个字符");
            return;
	    }
	    var wizid = document.getElementById("phoneSubInfo.xfFkWzid").value
		if( wizid==""){
			alert(" 发布位置不能为空!");
			return;
		}else if($.trim(wizid) == ''){
		    alert("此处不能为空格 !");
			return;			
		}else if (getLength(wizid) > 0 && getLength(wizid) > 10) {
            alert("不能多于10个字符,汉字占两个字符");
            return;
		}
		var lx = document.getElementById("phoneSubInfo.xfLx").value;
		if( lx ==""){
			alert("信息类型不能为空!");
			return;
		}else if($.trim(lx) == ''){
		    alert("此处不能为空格 !");
			return;			
		}else if (getLength(lx) > 0 && getLength(lx) > 10) {
            alert("不能多于10个字符,汉字占两个字符");
            return;
		}
		var context =document.getElementById("phoneSubInfo.xfLr").value;
		if( context==""){
			alert("信息内容不能为空!");
			return;
		}else if (context == null || context == "") {
			alert("信息内容不能为空");
			return false;
	    }
		else if (getLength(context) > 4000) {
			alert("信息内容长度小于4000");
	        return false;
						}
		fm.submit();
	}
	
function getLength(str) {
	if (str == null || str == "") {
		return 0;
	} else {
		var len = str.length;
		var reLen = 0;
		for ( var i = 0; i < len; i++) {
			if (str.charCodeAt(i) < 27 || str.charCodeAt(i) > 126) {
				reLen += 2;
			} else {
				reLen++;
			}
		}
		return reLen;
	}
}
</script>
</head>
<body>
		<s:form action="phoneSubInfoAction_update.do" namespace="/sub" method="post" >
			<table class="menu_table">
			
			
				<tr>
					<th>
						<a href="phoneSubInfoAction_list.do">手机管家信息发布管理</a>&gt;&gt;编辑手机管家信息发布
					</th>
				</tr>
			</table>
			<div class="listtable">
				<div class="secondDiv">
				
					<table class="form_table">
						<tr>
							<th width="20%">
								信息标题
							</th>
							<td width="15%">
								<s:textfield  name="phoneSubInfo.xfBt" id="phoneSubInfo.xfBt" ></s:textfield>
								 <s:hidden name="phoneSubInfo.xfId" id="phoneSubInfo.xfId" ></s:hidden>
							   <s:hidden name="phoneSubInfo.systemUser.suId" id="phoneSubInfo.systemUser.suId" ></s:hidden>
								<span class="txtblue" id="resultadminUser">*</span>
							</td>
						</tr>
						 <tr>
							<th width="20%">
							 发布位置
							</th>
							<td width="35%">
								<s:textfield  name="phoneSubInfo.xfFkWzid" id="phoneSubInfo.xfFkWzid" ></s:textfield>
								<span class="txtblue" id="resulpassword">*</span>
								
							</td>
						</tr>
						<tr>
							<th>
								信息类型
							</th>
							<td>
								<s:textfield name="phoneSubInfo.xfLx" id="phoneSubInfo.xfLx"
									></s:textfield>
									<span class="txtblue" id="resultadminUser">*</span>
							</td>
							
						</tr>
						<tr>
							<th>
								信息内容
							</th>
							<td>
								<s:textarea name="phoneSubInfo.xfLr" id="phoneSubInfo.xfLr" cols="20"/>
								<span class="txtblue" id="resultadminUser">*</span>
							</td>
						</tr>
					</table>
					
		<table width="50%" border="0" align="center" cellpadding="3" cellspacing="1">
			<s:token></s:token>
		    <tr>
		      <td align="center"  >
		      <div align="center">
		       	<input type="button" value="" class="apply_style" align="middle" onclick="submitFrom(this.form);"/>
		        <input type="button" onclick="javascript:location='phoneSubInfoAction_list.do'" class="back_style"  />
		        <input type="reset" id="重置 " class="reset_style" value=""/>
		       </div>
		       </td>
		    </tr>
		</table>
				</div>
			</div>
		</s:form>
	</body>
</html>
